<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/* asn1hex-1.2.15.js (c) 2012-2022 Kenji Urushima | kjur.github.io/jsrsasign/license
<span class='line'>  2</span>  */</span><span class="WHIT">
<span class='line'>  3</span> </span><span class="COMM">/*
<span class='line'>  4</span>  * asn1hex.js - Hexadecimal represented ASN.1 string library
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * Copyright (c) 2010-2022 Kenji Urushima (kenji.urushima@gmail.com)
<span class='line'>  7</span>  *
<span class='line'>  8</span>  * This software is licensed under the terms of the MIT License.
<span class='line'>  9</span>  * https://kjur.github.io/jsrsasign/license/
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * The above copyright and license notice shall be 
<span class='line'> 12</span>  * included in all copies or substantial portions of the Software.
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> 
<span class='line'> 15</span> </span><span class="COMM">/**
<span class='line'> 16</span>  * @fileOverview
<span class='line'> 17</span>  * @name asn1hex-1.1.js
<span class='line'> 18</span>  * @author Kenji Urushima kenji.urushima@gmail.com
<span class='line'> 19</span>  * @version jsrsasign 10.5.23 asn1hex 1.2.15 (2022-May-27)
<span class='line'> 20</span>  * @license &lt;a href="https://kjur.github.io/jsrsasign/license/">MIT License&lt;/a>
<span class='line'> 21</span>  */</span><span class="WHIT">
<span class='line'> 22</span> 
<span class='line'> 23</span> </span><span class="COMM">/*
<span class='line'> 24</span>  * MEMO:
<span class='line'> 25</span>  *   f('3082025b02...', 2) ... 82025b ... 3bytes
<span class='line'> 26</span>  *   f('020100', 2) ... 01 ... 1byte
<span class='line'> 27</span>  *   f('0203001...', 2) ... 03 ... 1byte
<span class='line'> 28</span>  *   f('02818003...', 2) ... 8180 ... 2bytes
<span class='line'> 29</span>  *   f('3080....0000', 2) ... 80 ... -1
<span class='line'> 30</span>  *
<span class='line'> 31</span>  *   Requirements:
<span class='line'> 32</span>  *   - ASN.1 type octet length MUST be 1. 
<span class='line'> 33</span>  *     (i.e. ASN.1 primitives like SET, SEQUENCE, INTEGER, OCTETSTRING ...)
<span class='line'> 34</span>  */</span><span class="WHIT">
<span class='line'> 35</span> 
<span class='line'> 36</span> </span><span class="COMM">/**
<span class='line'> 37</span>  * ASN.1 DER encoded hexadecimal string utility class
<span class='line'> 38</span>  * @name ASN1HEX
<span class='line'> 39</span>  * @class ASN.1 DER encoded hexadecimal string utility class
<span class='line'> 40</span>  * @since jsrsasign 1.1
<span class='line'> 41</span>  * @description
<span class='line'> 42</span>  * This class provides a parser for hexadecimal string of
<span class='line'> 43</span>  * DER encoded ASN.1 binary data.
<span class='line'> 44</span>  * Here are major methods of this class.
<span class='line'> 45</span>  * &lt;ul>
<span class='line'> 46</span>  * &lt;li>&lt;b>ACCESS BY POSITION&lt;/b>
<span class='line'> 47</span>  *   &lt;ul>
<span class='line'> 48</span>  *   &lt;li>{@link ASN1HEX.getTLV} - get ASN.1 TLV at specified position&lt;/li>
<span class='line'> 49</span>  *   &lt;li>{@link ASN1HEX.getTLVblen} - get byte length of ASN.1 TLV at specified position&lt;/li>
<span class='line'> 50</span>  *   &lt;li>{@link ASN1HEX.getV} - get ASN.1 V at specified position&lt;/li>
<span class='line'> 51</span>  *   &lt;li>{@link ASN1HEX.getVblen} - get integer ASN.1 L at specified position&lt;/li>
<span class='line'> 52</span>  *   &lt;li>{@link ASN1HEX.getVidx} - get ASN.1 V position from its ASN.1 TLV position&lt;/li>
<span class='line'> 53</span>  *   &lt;li>{@link ASN1HEX.getL} - get hexadecimal ASN.1 L at specified position&lt;/li>
<span class='line'> 54</span>  *   &lt;li>{@link ASN1HEX.getLblen} - get byte length for ASN.1 L(length) bytes&lt;/li>
<span class='line'> 55</span>  *   &lt;/ul>
<span class='line'> 56</span>  * &lt;/li>
<span class='line'> 57</span>  * &lt;li>&lt;b>ACCESS FOR CHILD ITEM&lt;/b>
<span class='line'> 58</span>  *   &lt;ul>
<span class='line'> 59</span>  *   &lt;li>{@link ASN1HEX.getNthChildIdx} - get nth child index at specified position&lt;/li>
<span class='line'> 60</span>  *   &lt;li>{@link ASN1HEX.getChildIdx} - get indexes of children&lt;/li>
<span class='line'> 61</span>  *   &lt;li>{@link ASN1HEX.getNextSiblingIdx} - get position of next sibling (DEPRECATED)&lt;/li>
<span class='line'> 62</span>  *   &lt;/ul>
<span class='line'> 63</span>  * &lt;/li>
<span class='line'> 64</span>  * &lt;li>&lt;b>ACCESS NESTED ASN.1 STRUCTURE&lt;/b>
<span class='line'> 65</span>  *   &lt;ul>
<span class='line'> 66</span>  *   &lt;li>{@link ASN1HEX.getTLVbyList} - get ASN.1 TLV at specified list index&lt;/li>
<span class='line'> 67</span>  *   &lt;li>{@link ASN1HEX.getVbyList} - get ASN.1 V at specified nth list index with checking expected tag&lt;/li>
<span class='line'> 68</span>  *   &lt;li>{@link ASN1HEX.getIdxbyList} - get index at specified list index&lt;/li>
<span class='line'> 69</span>  *   &lt;/ul>
<span class='line'> 70</span>  * &lt;/li>
<span class='line'> 71</span>  * &lt;li>&lt;b>(NEW)ACCESS NESTED ASN.1 STRUCTURE&lt;/b>
<span class='line'> 72</span>  *   &lt;ul>
<span class='line'> 73</span>  *   &lt;li>{@link ASN1HEX.getTLVbyListEx} - get ASN.1 TLV at specified list index&lt;/li>
<span class='line'> 74</span>  *   &lt;li>{@link ASN1HEX.getVbyListEx} - get ASN.1 V at specified nth list index with checking expected tag&lt;/li>
<span class='line'> 75</span>  *   &lt;li>{@link ASN1HEX.getIdxbyListEx} - get index at specified list index&lt;/li>
<span class='line'> 76</span>  *   &lt;/ul>
<span class='line'> 77</span>  * &lt;/li>
<span class='line'> 78</span>  * &lt;li>&lt;b>UTILITIES&lt;/b>
<span class='line'> 79</span>  *   &lt;ul>
<span class='line'> 80</span>  *   &lt;li>{@link ASN1HEX.dump} - dump ASN.1 structure&lt;/li>
<span class='line'> 81</span>  *   &lt;li>{@link ASN1HEX.isContextTag} - check if a hexadecimal tag is a specified ASN.1 context specific tag&lt;/li>
<span class='line'> 82</span>  *   &lt;li>{@link ASN1HEX.isASN1HEX} - simple ASN.1 DER hexadecimal string checker&lt;/li>
<span class='line'> 83</span>  *   &lt;li>{@link ASN1HEX.checkStrictDER} - strict ASN.1 DER hexadecimal string checker&lt;/li>
<span class='line'> 84</span>  *   &lt;li>{@link ASN1HEX.hextooidstr} - convert hexadecimal string of OID to dotted integer list&lt;/li>
<span class='line'> 85</span>  *   &lt;/ul>
<span class='line'> 86</span>  * &lt;/li>
<span class='line'> 87</span>  * &lt;/ul>
<span class='line'> 88</span>  */</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 91</span> 
<span class='line'> 92</span> </span><span class="COMM">/**
<span class='line'> 93</span>  * get byte length for ASN.1 L(length) bytes&lt;br/>
<span class='line'> 94</span>  * @name getLblen
<span class='line'> 95</span>  * @memberOf ASN1HEX
<span class='line'> 96</span>  * @function
<span class='line'> 97</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'> 98</span>  * @param {Number} idx string index
<span class='line'> 99</span>  * @return byte length for ASN.1 L(length) bytes
<span class='line'>100</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>101</span>  * @example
<span class='line'>102</span>  * ASN1HEX.getLblen('020100', 0) &rarr; 1 for '01'
<span class='line'>103</span>  * ASN1HEX.getLblen('020200', 0) &rarr; 1 for '02'
<span class='line'>104</span>  * ASN1HEX.getLblen('02818003...', 0) &rarr; 2 for '8180'
<span class='line'>105</span>  * ASN1HEX.getLblen('0282025b03...', 0) &rarr; 3 for '82025b'
<span class='line'>106</span>  * ASN1HEX.getLblen('0280020100...', 0) &rarr; -1 for '80' BER indefinite length
<span class='line'>107</span>  * ASN1HEX.getLblen('02ffab...', 0) &rarr; -2 for malformed ASN.1 length
<span class='line'>108</span>  */</span><span class="WHIT">
<span class='line'>109</span> </span><span class="NAME">ASN1HEX.getLblen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'8'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">s.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">             </span><span class="COMM">// length octet '80' indefinite length</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// including '8?' octet;</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">                         </span><span class="COMM">// malformed format</span><span class="WHIT">
<span class='line'>115</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> 
<span class='line'>117</span> </span><span class="COMM">/**
<span class='line'>118</span>  * get hexadecimal string for ASN.1 L(length) bytes&lt;br/>
<span class='line'>119</span>  * @name getL
<span class='line'>120</span>  * @memberOf ASN1HEX
<span class='line'>121</span>  * @function
<span class='line'>122</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'>123</span>  * @param {Number} idx string index to get L of ASN.1 object
<span class='line'>124</span>  * @return {String} hexadecimal string for ASN.1 L(length) bytes
<span class='line'>125</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>126</span>  */</span><span class="WHIT">
<span class='line'>127</span> </span><span class="NAME">ASN1HEX.getL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getLblen</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> 
<span class='line'>133</span> </span><span class="COMM">/**
<span class='line'>134</span>  * get integer value of ASN.1 length for ASN.1 data&lt;br/>
<span class='line'>135</span>  * @name getVblen
<span class='line'>136</span>  * @memberOf ASN1HEX
<span class='line'>137</span>  * @function
<span class='line'>138</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'>139</span>  * @param {Number} idx string index
<span class='line'>140</span>  * @return {Number} ASN.1 L(length) integer value
<span class='line'>141</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>142</span>  */</span><span class="WHIT">
<span class='line'>143</span> </span><span class="COMM">/*
<span class='line'>144</span>  getting ASN.1 length value at the position 'idx' of
<span class='line'>145</span>  hexa decimal string 's'.
<span class='line'>146</span>  f('3082025b02...', 0) ... 82025b ... ???
<span class='line'>147</span>  f('020100', 0) ... 01 ... 1
<span class='line'>148</span>  f('0203001...', 0) ... 03 ... 3
<span class='line'>149</span>  f('02818003...', 0) ... 8180 ... 128
<span class='line'>150</span>  */</span><span class="WHIT">
<span class='line'>151</span> </span><span class="NAME">ASN1HEX.getVblen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hLen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bi</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">    </span><span class="NAME">hLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getL</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hLen</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hLen.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'8'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">        </span><span class="NAME">bi</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">BigInteger</span><span class="PUNC">(</span><span class="NAME">hLen.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT">        </span><span class="NAME">bi</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">BigInteger</span><span class="PUNC">(</span><span class="NAME">hLen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bi.intValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> 
<span class='line'>163</span> </span><span class="COMM">/**
<span class='line'>164</span>  * get ASN.1 value starting string position for ASN.1 object refered by index 'idx'.
<span class='line'>165</span>  * @name getVidx
<span class='line'>166</span>  * @memberOf ASN1HEX
<span class='line'>167</span>  * @function
<span class='line'>168</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'>169</span>  * @param {Number} idx string index
<span class='line'>170</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>171</span>  */</span><span class="WHIT">
<span class='line'>172</span> </span><span class="NAME">ASN1HEX.getVidx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l_len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getLblen</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">l_len</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">l_len</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">l_len</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>177</span> 
<span class='line'>178</span> </span><span class="COMM">/**
<span class='line'>179</span>  * get hexadecimal string of ASN.1 V(value)&lt;br/>
<span class='line'>180</span>  * @name getV
<span class='line'>181</span>  * @memberOf ASN1HEX
<span class='line'>182</span>  * @function
<span class='line'>183</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'>184</span>  * @param {Number} idx string index
<span class='line'>185</span>  * @return {String} hexadecimal string of ASN.1 value.
<span class='line'>186</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>187</span>  */</span><span class="WHIT">
<span class='line'>188</span> </span><span class="NAME">ASN1HEX.getV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getVidx</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">blen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s.substr</span><span class="PUNC">(</span><span class="NAME">idx1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">blen</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> 
<span class='line'>194</span> </span><span class="COMM">/**
<span class='line'>195</span>  * get hexadecimal string of ASN.1 TLV at&lt;br/>
<span class='line'>196</span>  * @name getTLV
<span class='line'>197</span>  * @memberOf ASN1HEX
<span class='line'>198</span>  * @function
<span class='line'>199</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'>200</span>  * @param {Number} idx string index
<span class='line'>201</span>  * @return {String} hexadecimal string of ASN.1 TLV.
<span class='line'>202</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>203</span>  */</span><span class="WHIT">
<span class='line'>204</span> </span><span class="NAME">ASN1HEX.getTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getL</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getV</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>206</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>207</span> 
<span class='line'>208</span> </span><span class="COMM">/**
<span class='line'>209</span>  * get byte length of ASN.1 TLV at specified string index&lt;br/>
<span class='line'>210</span>  * @name getTLVblen
<span class='line'>211</span>  * @memberOf ASN1HEX
<span class='line'>212</span>  * @function
<span class='line'>213</span>  * @param {String} h hexadecimal string of ASN.1 DER encoded data
<span class='line'>214</span>  * @param {Number} idx string index to get ASN.1 TLV byte length
<span class='line'>215</span>  * @return {Number} byte length of ASN.1 TLV
<span class='line'>216</span>  * @since jsrsasign 9.1.5 asn1hex 1.1.11
<span class='line'>217</span>  *
<span class='line'>218</span>  * @description
<span class='line'>219</span>  * This method returns a byte length of ASN.1 TLV at
<span class='line'>220</span>  * specified string index.
<span class='line'>221</span>  *
<span class='line'>222</span>  * @example
<span class='line'>223</span>  *                        v string indx=42
<span class='line'>224</span>  * ASN1HEX.getTLVblen("...1303616161...", 42) &rarr; 10 (PrintableString 'aaa')
<span class='line'>225</span>  */</span><span class="WHIT">
<span class='line'>226</span> </span><span class="NAME">ASN1HEX.getTLVblen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getLblen</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>228</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> 
<span class='line'>230</span> </span><span class="COMM">// ========== sibling methods ================================</span><span class="WHIT">
<span class='line'>231</span> 
<span class='line'>232</span> </span><span class="COMM">/**
<span class='line'>233</span>  * get next sibling starting index for ASN.1 object string (DEPRECATED)&lt;br/>
<span class='line'>234</span>  * @name getNextSiblingIdx
<span class='line'>235</span>  * @memberOf ASN1HEX
<span class='line'>236</span>  * @function
<span class='line'>237</span>  * @param {String} s hexadecimal string of ASN.1 DER encoded data
<span class='line'>238</span>  * @param {Number} idx string index
<span class='line'>239</span>  * @return {Number} next sibling starting index for ASN.1 object string
<span class='line'>240</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>241</span>  * @deprecated jsrsasign 9.1.5 asn1hex 1.2.5 Please use {@link ASN1HEX.getTLVblen}
<span class='line'>242</span>  *
<span class='line'>243</span>  * @example
<span class='line'>244</span>  * SEQUENCE { INTEGER 3, INTEGER 4 }
<span class='line'>245</span>  * 3006
<span class='line'>246</span>  *     020103 :idx=4
<span class='line'>247</span>  *           020104 :next sibling idx=10
<span class='line'>248</span>  * getNextSiblingIdx("3006020103020104", 4) & rarr 10
<span class='line'>249</span>  */</span><span class="WHIT">
<span class='line'>250</span> </span><span class="NAME">ASN1HEX.getNextSiblingIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getVidx</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">blen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">idx1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">blen</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>254</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>255</span> 
<span class='line'>256</span> </span><span class="COMM">// ========== children methods ===============================</span><span class="WHIT">
<span class='line'>257</span> </span><span class="COMM">/**
<span class='line'>258</span>  * get array of string indexes of child ASN.1 objects&lt;br/>
<span class='line'>259</span>  * @name getChildIdx
<span class='line'>260</span>  * @memberOf ASN1HEX
<span class='line'>261</span>  * @function
<span class='line'>262</span>  * @param {String} h hexadecimal string of ASN.1 DER encoded data
<span class='line'>263</span>  * @param {Number} idx start string index of ASN.1 object
<span class='line'>264</span>  * @return {Array of Number} array of indexes for childen of ASN.1 objects
<span class='line'>265</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>266</span>  * @description
<span class='line'>267</span>  * This method returns array of integers for a concatination of ASN.1 objects
<span class='line'>268</span>  * in a ASN.1 value. As for BITSTRING, one byte of unusedbits is skipped.
<span class='line'>269</span>  * As for other ASN.1 simple types such as INTEGER, OCTET STRING or PRINTABLE STRING,
<span class='line'>270</span>  * it returns a array of a string index of its ASN.1 value.&lt;br/>
<span class='line'>271</span>  * NOTE: Since asn1hex 1.1.7 of jsrsasign 6.1.2, Encapsulated BitString is supported.
<span class='line'>272</span>  * @example
<span class='line'>273</span>  * ASN1HEX.getChildIdx("0203012345", 0) &rArr; [4] // INTEGER 012345
<span class='line'>274</span>  * ASN1HEX.getChildIdx("1303616161", 0) &rArr; [4] // PrintableString aaa
<span class='line'>275</span>  * ASN1HEX.getChildIdx("030300ffff", 0) &rArr; [6] // BITSTRING ffff (unusedbits=00a)
<span class='line'>276</span>  * ASN1HEX.getChildIdx("3006020104020105", 0) &rArr; [4, 10] // SEQUENCE(INT4,INT5)
<span class='line'>277</span>  */</span><span class="WHIT">
<span class='line'>278</span> </span><span class="NAME">ASN1HEX.getChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idxStart</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">totalChildBlen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentChildBlen</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>282</span> 
<span class='line'>283</span> </span><span class="WHIT">    </span><span class="NAME">idxStart</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVidx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">    </span><span class="NAME">totalChildBlen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// BITSTRING without unusedbits</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">	</span><span class="NAME">idxStart</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">	</span><span class="NAME">totalChildBlen</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>289</span> 
<span class='line'>290</span> </span><span class="WHIT">    </span><span class="NAME">currentChildBlen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">idxStart</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">currentChildBlen</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">totalChildBlen</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tlvBlen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLVblen</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT">	</span><span class="NAME">currentChildBlen</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tlvBlen</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">currentChildBlen</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">totalChildBlen</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">	</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tlvBlen</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">currentChildBlen</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">totalChildBlen</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>301</span> 
<span class='line'>302</span> </span><span class="COMM">/**
<span class='line'>303</span>  * get string index of nth child object of ASN.1 object refered by h, idx&lt;br/>
<span class='line'>304</span>  * @name getNthChildIdx
<span class='line'>305</span>  * @memberOf ASN1HEX
<span class='line'>306</span>  * @function
<span class='line'>307</span>  * @param {String} h hexadecimal string of ASN.1 DER encoded data
<span class='line'>308</span>  * @param {Number} idx start string index of ASN.1 object
<span class='line'>309</span>  * @param {Number} nth for child
<span class='line'>310</span>  * @return {Number} string index of nth child.
<span class='line'>311</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>312</span>  */</span><span class="WHIT">
<span class='line'>313</span> </span><span class="NAME">ASN1HEX.getNthChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">nth</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>317</span> 
<span class='line'>318</span> </span><span class="COMM">// ========== decendant methods ==============================</span><span class="WHIT">
<span class='line'>319</span> </span><span class="COMM">/**
<span class='line'>320</span>  * get string index of nth child object of ASN.1 object refered by h, idx&lt;br/>
<span class='line'>321</span>  * @name getIdxbyList
<span class='line'>322</span>  * @memberOf ASN1HEX
<span class='line'>323</span>  * @function
<span class='line'>324</span>  * @param {String} h hexadecimal string of ASN.1 DER encoded data
<span class='line'>325</span>  * @param {Number} currentIndex start string index of ASN.1 object
<span class='line'>326</span>  * @param {Array of Number} nthList array list of nth
<span class='line'>327</span>  * @param {String} checkingTag (OPTIONAL) string of expected ASN.1 tag for nthList 
<span class='line'>328</span>  * @return {Number} string index refered by nthList
<span class='line'>329</span>  * @since jsrsasign 7.1.4 asn1hex 1.1.10.
<span class='line'>330</span>  * @description
<span class='line'>331</span>  * @example
<span class='line'>332</span>  * The "nthList" is a index list of structured ASN.1 object
<span class='line'>333</span>  * reference. Here is a sample structure and "nthList"s which
<span class='line'>334</span>  * refers each objects.
<span class='line'>335</span>  *
<span class='line'>336</span>  * SQUENCE               - 
<span class='line'>337</span>  *   SEQUENCE            - [0]
<span class='line'>338</span>  *     IA5STRING 000     - [0, 0]
<span class='line'>339</span>  *     UTF8STRING 001    - [0, 1]
<span class='line'>340</span>  *   SET                 - [1]
<span class='line'>341</span>  *     IA5STRING 010     - [1, 0]
<span class='line'>342</span>  *     UTF8STRING 011    - [1, 1]
<span class='line'>343</span>  */</span><span class="WHIT">
<span class='line'>344</span> </span><span class="NAME">ASN1HEX.getIdxbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">firstNth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nthList.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">checkingTag</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">    </span><span class="NAME">firstNth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nthList.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">firstNth</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>356</span> 
<span class='line'>357</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyList</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">firstNth</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>358</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>359</span> 
<span class='line'>360</span> </span><span class="COMM">/**
<span class='line'>361</span>  * get string index of nth child object of ASN.1 object refered by h, idx&lt;br/>
<span class='line'>362</span>  * @name getIdxbyListEx
<span class='line'>363</span>  * @memberOf ASN1HEX
<span class='line'>364</span>  * @function
<span class='line'>365</span>  * @param {String} h hexadecimal string of ASN.1 DER encoded data
<span class='line'>366</span>  * @param {Number} currentIndex start string index of ASN.1 object
<span class='line'>367</span>  * @param {Array of Object} nthList array list of nth index value or context specific tag string (ex. "[0]")
<span class='line'>368</span>  * @param {String} checkingTag (OPTIONAL) string of expected ASN.1 tag for nthList 
<span class='line'>369</span>  * @return {Number} string index refered by nthList. return -1 if not found
<span class='line'>370</span>  * @since jsrsasign 8.0.21 asn1hex 1.2.2
<span class='line'>371</span>  * @see &lt;a href="https://github.com/kjur/jsrsasign/wiki/Tutorial-for-accessing-deep-inside-of-ASN.1-structure-by-using-new-ASN1HEX.getIdxbyListEx">ASN1HEX.getIdxbyListEx tutorial wiki page&lt;/a>
<span class='line'>372</span>  *
<span class='line'>373</span>  * @description
<span class='line'>374</span>  * This method returns the string index in h specified by currentIndex and
<span class='line'>375</span>  * nthList. This is useful to dig into a deep structured ASN.1 object
<span class='line'>376</span>  * by indexes called nthList. 
<span class='line'>377</span>  * &lt;br/>
<span class='line'>378</span>  * A nthList consists of a position number in children of ASN.1
<span class='line'>379</span>  * structured data or a context specific tag string (ex. "[1]").
<span class='line'>380</span>  * Here is a sample deep structured ASN.1 data and
<span class='line'>381</span>  * nthLists referring decendent objects.
<span class='line'>382</span>  * &lt;blockquote>&lt;pre>
<span class='line'>383</span>  * SQUENCE               - referring nthList is below:
<span class='line'>384</span>  *   SEQUENCE            - [0]
<span class='line'>385</span>  *     IA5STRING "a1"    - [0, 0]
<span class='line'>386</span>  *     UTF8STRING "a2"   - [0, 1]
<span class='line'>387</span>  *   SET                 - [1]
<span class='line'>388</span>  *     IA5STRING "b1"    - [1, 0]
<span class='line'>389</span>  *     UTF8STRING "b2"   - [1, 1]
<span class='line'>390</span>  *     [0] "b3"          - [1, "[0]"] // optional since context tag
<span class='line'>391</span>  *     [1] "b4"          - [1, "[1]"] // optional since context tag
<span class='line'>392</span>  *     IA5STRING "b5"    - [1, 2] // context is skipped. next is 2
<span class='line'>393</span>  *     UTF8STRING "b6"   - [1, 3]
<span class='line'>394</span>  * &lt;/pre>&lt;/blockquote>
<span class='line'>395</span>  *
<span class='line'>396</span>  * &lt;br/>
<span class='line'>397</span>  * This method can dig into ASN.1 object encapsulated by
<span class='line'>398</span>  * OctetString or BitString with unused bits.
<span class='line'>399</span>  *
<span class='line'>400</span>  * @example
<span class='line'>401</span>  * 3014 seq idx=0
<span class='line'>402</span>  *   3012 seq idx=4
<span class='line'>403</span>  *     020101 int:1 idx=8
<span class='line'>404</span>  *     020102 int:2 idx=14
<span class='line'>405</span>  *     800103 [0]:3 idx=20
<span class='line'>406</span>  *     810104 [1]:4 idx=26
<span class='line'>407</span>  *     020105 int:5 idx=32
<span class='line'>408</span>  *     020106 int:6 idx=38
<span class='line'>409</span>  * h = "30140412020101020102800103810104020105020106";
<span class='line'>410</span>  * ASN1HEX.getIdxbyListEx(h, 0, [0, "[0]"]) &rarr; 16
<span class='line'>411</span>  * ASN1HEX.getIdxbyListEx(h, 0, [0, 2]) &rarr; 28
<span class='line'>412</span>  * ASN1HEX.getIdxbyListEx(h, 0, [0, 2], "0c") &rarr; -1 //not UTF8String(0c)
<span class='line'>413</span>  */</span><span class="WHIT">
<span class='line'>414</span> </span><span class="NAME">ASN1HEX.getIdxbyListEx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>416</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">firstNth</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">nthList.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">checkingTag</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">    </span><span class="NAME">firstNth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">nthList.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>427</span> 
<span class='line'>428</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">childTag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>431</span> 
<span class='line'>432</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">firstNth</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"number"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT">	     </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.isContextTag</span><span class="PUNC">(</span><span class="NAME">childTag</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT">	     </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">firstNth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT">	    </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">firstNth</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">	     </span><span class="NAME">_ASN1HEX.isContextTag</span><span class="PUNC">(</span><span class="NAME">childTag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">firstNth</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyListEx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.isContextTag</span><span class="PUNC">(</span><span class="NAME">childTag</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>442</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> 
<span class='line'>444</span> </span><span class="COMM">/**
<span class='line'>445</span>  * get ASN.1 TLV by nthList&lt;br/>
<span class='line'>446</span>  * @name getTLVbyList
<span class='line'>447</span>  * @memberOf ASN1HEX
<span class='line'>448</span>  * @function
<span class='line'>449</span>  * @param {String} h hexadecimal string of ASN.1 structure
<span class='line'>450</span>  * @param {Integer} currentIndex string index to start searching in hexadecimal string "h"
<span class='line'>451</span>  * @param {Array} nthList array of nth list index
<span class='line'>452</span>  * @param {String} checkingTag (OPTIONAL) string of expected ASN.1 tag for nthList 
<span class='line'>453</span>  * @return {String} referred hexadecimal string of ASN.1 TLV or null
<span class='line'>454</span>  * @since jsrsasign 7.1.4 asn1hex 1.1.10
<span class='line'>455</span>  *
<span class='line'>456</span>  * @description
<span class='line'>457</span>  * This static method is to get a ASN.1 value which specified "nthList" position
<span class='line'>458</span>  * with checking expected tag "checkingTag".
<span class='line'>459</span>  * &lt;br/>
<span class='line'>460</span>  * When referring value can't be found, this returns null.
<span class='line'>461</span>  */</span><span class="WHIT">
<span class='line'>462</span> </span><span class="NAME">ASN1HEX.getTLVbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyList</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>465</span> 
<span class='line'>466</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">h.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>468</span> 
<span class='line'>469</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>470</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>471</span> 
<span class='line'>472</span> </span><span class="COMM">/**
<span class='line'>473</span>  * get ASN.1 TLV by nthList&lt;br/>
<span class='line'>474</span>  * @name getTLVbyListEx
<span class='line'>475</span>  * @memberOf ASN1HEX
<span class='line'>476</span>  * @function
<span class='line'>477</span>  * @param {String} h hexadecimal string of ASN.1 structure
<span class='line'>478</span>  * @param {Integer} currentIndex string index to start searching in hexadecimal string "h"
<span class='line'>479</span>  * @param {Array of Object} nthList array list of nth index value or context specific tag string (ex. "[0]")
<span class='line'>480</span>  * @param {String} checkingTag (OPTIONAL) string of expected ASN.1 tag for nthList 
<span class='line'>481</span>  * @return {String} hexadecimal ASN.1 TLV string refered by nthList. return null if not found
<span class='line'>482</span>  * @since jsrsasign 8.0.21 asn1hex 1.2.2
<span class='line'>483</span>  * @see &lt;a href="https://github.com/kjur/jsrsasign/wiki/Tutorial-for-accessing-deep-inside-of-ASN.1-structure-by-using-new-ASN1HEX.getIdxbyListEx">ASN1HEX.getIdxbyListEx tutorial wiki page&lt;/a>
<span class='line'>484</span>  * @see {@link ASN1HEX.getIdxbyListEx}
<span class='line'>485</span>  * @description
<span class='line'>486</span>  * This static method is to get a ASN.1 value which specified "nthList" position
<span class='line'>487</span>  * with checking expected tag "checkingTag".
<span class='line'>488</span>  * This method can dig into ASN.1 object encapsulated by
<span class='line'>489</span>  * OctetString or BitString with unused bits.
<span class='line'>490</span>  * @example
<span class='line'>491</span>  * 3014 seq idx=0
<span class='line'>492</span>  *   0312 seq idx=4
<span class='line'>493</span>  *     020101 int:1 idx=8
<span class='line'>494</span>  *     020102 int:2 idx=14
<span class='line'>495</span>  *     800103 [0]:3 idx=20
<span class='line'>496</span>  *     810104 [1]:4 idx=26
<span class='line'>497</span>  *     020105 int:5 idx=32
<span class='line'>498</span>  *     020106 int:6 idx=38
<span class='line'>499</span>  * h = "30140412020101020102800103810104020105020106";
<span class='line'>500</span>  * ASN1HEX.getTLVbyList(h, 0, [0, "[0]"]) &rarr; 800103
<span class='line'>501</span>  * ASN1HEX.getTLVbyList(h, 0, [0, 2]) &rarr; 020105
<span class='line'>502</span>  * ASN1HEX.getTLVbyList(h, 0, [0, 2], "0c") &rarr; null //not UTF8String(0c)
<span class='line'>503</span>  */</span><span class="WHIT">
<span class='line'>504</span> </span><span class="NAME">ASN1HEX.getTLVbyListEx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyListEx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>509</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>510</span> 
<span class='line'>511</span> </span><span class="COMM">/**
<span class='line'>512</span>  * get ASN.1 value by nthList&lt;br/>
<span class='line'>513</span>  * @name getVbyList
<span class='line'>514</span>  * @memberOf ASN1HEX
<span class='line'>515</span>  * @function
<span class='line'>516</span>  * @param {String} h hexadecimal string of ASN.1 structure
<span class='line'>517</span>  * @param {Integer} currentIndex string index to start searching in hexadecimal string "h"
<span class='line'>518</span>  * @param {Array} nthList array of nth list index
<span class='line'>519</span>  * @param {String} checkingTag (OPTIONAL) string of expected ASN.1 tag for nthList 
<span class='line'>520</span>  * @param {Boolean} removeUnusedbits (OPTIONAL) flag for remove first byte for value (DEFAULT false)
<span class='line'>521</span>  * @return {String} referred hexadecimal string of ASN.1 value(V) or null
<span class='line'>522</span>  * @since asn1hex 1.1.4
<span class='line'>523</span>  * @see ASN1HEX.getIdxbyList
<span class='line'>524</span>  * @see ASN1HEX.getVbyListEx
<span class='line'>525</span>  *
<span class='line'>526</span>  * @description
<span class='line'>527</span>  * This static method is to get a ASN.1 value which specified "nthList" position
<span class='line'>528</span>  * with checking expected tag "checkingTag".
<span class='line'>529</span>  * &lt;br/>
<span class='line'>530</span>  * When referring value can't be found, this returns null.
<span class='line'>531</span>  * &lt;br/>
<span class='line'>532</span>  * NOTE: 'removeUnusedbits' flag has been supported since
<span class='line'>533</span>  * jsrsasign 7.1.14 asn1hex 1.1.10.
<span class='line'>534</span>  */</span><span class="WHIT">
<span class='line'>535</span> </span><span class="NAME">ASN1HEX.getVbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">removeUnusedbits</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT">    </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyList</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT">    
<span class='line'>540</span>     </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">h.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>542</span> 
<span class='line'>543</span> </span><span class="WHIT">    </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">removeUnusedbits</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">v.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>547</span> 
<span class='line'>548</span> </span><span class="COMM">/**
<span class='line'>549</span>  * get ASN.1 V by nthList&lt;br/>
<span class='line'>550</span>  * @name getVbyListEx
<span class='line'>551</span>  * @memberOf ASN1HEX
<span class='line'>552</span>  * @function
<span class='line'>553</span>  * @param {String} h hexadecimal string of ASN.1 structure
<span class='line'>554</span>  * @param {Integer} currentIndex string index to start searching in hexadecimal string "h"
<span class='line'>555</span>  * @param {Array of Object} nthList array list of nth index value or context specific tag string (ex. "[0]")
<span class='line'>556</span>  * @param {String} checkingTag (OPTIONAL) string of expected ASN.1 tag for nthList (default is undefined)
<span class='line'>557</span>  * @param {Boolean} removeUnusedbits (OPTIONAL) flag for trim unused bit from result value (default is undefined)
<span class='line'>558</span>  * @return {String} hexadecimal ASN.1 V string refered by nthList. return null if not found
<span class='line'>559</span>  * @since jsrsasign 8.0.21 asn1hex 1.2.2
<span class='line'>560</span>  * @see &lt;a href="https://github.com/kjur/jsrsasign/wiki/Tutorial-for-accessing-deep-inside-of-ASN.1-structure-by-using-new-ASN1HEX.getIdxbyListEx">ASN1HEX.getIdxbyListEx tutorial wiki page&lt;/a>
<span class='line'>561</span>  * @see {@link ASN1HEX.getIdxbyListEx}
<span class='line'>562</span>  *
<span class='line'>563</span>  * @description
<span class='line'>564</span>  * This static method is to get a ASN.1 value which specified "nthList" position
<span class='line'>565</span>  * with checking expected tag "checkingTag".
<span class='line'>566</span>  * This method can dig into ASN.1 object encapsulated by
<span class='line'>567</span>  * OctetString or BitString with unused bits.
<span class='line'>568</span>  *
<span class='line'>569</span>  * @example
<span class='line'>570</span>  * 3014 seq idx=0
<span class='line'>571</span>  *   3012 seq idx=4
<span class='line'>572</span>  *     020101 int:1 idx=8
<span class='line'>573</span>  *     020102 int:2 idx=14
<span class='line'>574</span>  *     800103 [0]:3 idx=20
<span class='line'>575</span>  *     810104 [1]:4 idx=26
<span class='line'>576</span>  *     020105 int:5 idx=32
<span class='line'>577</span>  *     020106 int:6 idx=38
<span class='line'>578</span>  * h = "30140412020101020102800103810104020105020106";
<span class='line'>579</span>  * ASN1HEX.getTLVbyList(h, 0, [0, "[0]"]) &rarr; 03
<span class='line'>580</span>  * ASN1HEX.getTLVbyList(h, 0, [0, 2]) &rarr; 05
<span class='line'>581</span>  * ASN1HEX.getTLVbyList(h, 0, [0, 2], "0c") &rarr; null //not UTF8String(0c)
<span class='line'>582</span>  */</span><span class="WHIT">
<span class='line'>583</span> </span><span class="NAME">ASN1HEX.getVbyListEx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">removeUnusedbits</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>585</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tlv</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>586</span> </span><span class="WHIT">    </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyListEx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">currentIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nthList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checkingTag</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>587</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT">    </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>589</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">removeUnusedbits</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">v.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>591</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>592</span> 
<span class='line'>593</span> </span><span class="COMM">/**
<span class='line'>594</span>  * get integer value from ASN.1 V(value) of Integer or BitString&lt;br/>
<span class='line'>595</span>  * @name getInt
<span class='line'>596</span>  * @memberOf ASN1HEX
<span class='line'>597</span>  * @function
<span class='line'>598</span>  * @param {String} h hexadecimal string
<span class='line'>599</span>  * @param {Number} idx string index in h to get ASN.1 DER Integer or BitString
<span class='line'>600</span>  * @param {Object} errorReturn (OPTION) error return value (DEFAULT: -1)
<span class='line'>601</span>  * @return {Number} ASN.1 DER Integer or BitString value
<span class='line'>602</span>  * @since jsrsasign 10.1.0 asn1hex 1.2.7
<span class='line'>603</span>  * @see bitstrtoint
<span class='line'>604</span>  *
<span class='line'>605</span>  * @example
<span class='line'>606</span>  * ASN1HEX.getInt("xxxx020103xxxxxx", 4) &rarr 3 // DER Integer
<span class='line'>607</span>  * ASN1HEX.getInt("xxxx03020780xxxxxx", 4) &rarr 1 // DER BitStringx
<span class='line'>608</span>  * ASN1HEX.getInt("xxxx030203c8xxxxxx", 4) &rarr 25 // DER BitStringx
<span class='line'>609</span>  */</span><span class="WHIT">
<span class='line'>610</span> </span><span class="NAME">ASN1HEX.getInt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hTag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hTag</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"02"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">hTag</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hTag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"02"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>619</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bitstrtoint</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>620</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>623</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>624</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>625</span> 
<span class='line'>626</span> </span><span class="COMM">/**
<span class='line'>627</span>  * get object identifier string from ASN.1 V(value)&lt;br/>
<span class='line'>628</span>  * @name getOID
<span class='line'>629</span>  * @memberOf ASN1HEX
<span class='line'>630</span>  * @function
<span class='line'>631</span>  * @param {String} h hexadecimal string
<span class='line'>632</span>  * @param {Number} idx string index in h to get ASN.1 DER ObjectIdentifier
<span class='line'>633</span>  * @param {Object} errorReturn (OPTION) error return value (DEFAULT: null)
<span class='line'>634</span>  * @return {String} object identifier string (ex. "1.2.3.4")
<span class='line'>635</span>  * @since jsrsasign 10.1.0 asn1hex 1.2.7
<span class='line'>636</span>  *
<span class='line'>637</span>  * @example
<span class='line'>638</span>  * ASN1HEX.getInt("xxxx06032a0304xxxxxx", 4) &rarr "1.2.3.4"
<span class='line'>639</span>  */</span><span class="WHIT">
<span class='line'>640</span> </span><span class="NAME">ASN1HEX.getOID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>641</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>642</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>643</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>644</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hOID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>645</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">hextooid</span><span class="PUNC">(</span><span class="NAME">hOID</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>646</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>647</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>648</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>649</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>650</span> 
<span class='line'>651</span> </span><span class="COMM">/**
<span class='line'>652</span>  * get object identifier name from ASN.1 V(value)&lt;br/>
<span class='line'>653</span>  * @name getOIDName
<span class='line'>654</span>  * @memberOf ASN1HEX
<span class='line'>655</span>  * @function
<span class='line'>656</span>  * @param {String} h hexadecimal string
<span class='line'>657</span>  * @param {Number} idx string index in h to get ASN.1 DER ObjectIdentifier
<span class='line'>658</span>  * @param {Object} errorReturn (OPTION) error return value (DEFAULT: null)
<span class='line'>659</span>  * @return {String} object identifier name (ex. "sha256") oir OID string
<span class='line'>660</span>  * @since jsrsasign 10.1.0 asn1hex 1.2.7
<span class='line'>661</span>  *
<span class='line'>662</span>  * @description
<span class='line'>663</span>  * This static method returns object identifier name such as "sha256"
<span class='line'>664</span>  * if registered. If not registered, it returns OID string. 
<span class='line'>665</span>  * (ex. "1.2.3.4")
<span class='line'>666</span>  *
<span class='line'>667</span>  * @example
<span class='line'>668</span>  * ASN1HEX.getOIDName("xxxx0609608648016503040201xxxxxx", 4) &rarr "sha256"
<span class='line'>669</span>  * ASN1HEX.getOIDName("xxxx06032a0304xxxxxx", 4) &rarr "1.2.3.4"
<span class='line'>670</span>  */</span><span class="WHIT">
<span class='line'>671</span> </span><span class="NAME">ASN1HEX.getOIDName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>673</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>674</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getOID</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.oid2name</span><span class="PUNC">(</span><span class="NAME">oid</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>677</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>678</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>679</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>680</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>681</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>682</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>683</span> 
<span class='line'>684</span> </span><span class="COMM">/**
<span class='line'>685</span>  * get raw string from ASN.1 V(value)&lt;br/>
<span class='line'>686</span>  * @name getString
<span class='line'>687</span>  * @memberOf ASN1HEX
<span class='line'>688</span>  * @function
<span class='line'>689</span>  * @param {String} h hexadecimal string
<span class='line'>690</span>  * @param {Number} idx string index in h to get any ASN.1 DER String
<span class='line'>691</span>  * @param {Object} errorReturn (OPTION) error return value (DEFAULT: null)
<span class='line'>692</span>  * @return {String} raw string
<span class='line'>693</span>  * @since jsrsasign 10.1.3 asn1hex 1.2.8
<span class='line'>694</span>  *
<span class='line'>695</span>  * @description
<span class='line'>696</span>  * This static method returns a raw string from
<span class='line'>697</span>  * any ASN.1 DER primitives.
<span class='line'>698</span>  *
<span class='line'>699</span>  * @example
<span class='line'>700</span>  * ASN1HEX.getString("xxxx1303616161xxxxxx", 4) &rarr "aaa"
<span class='line'>701</span>  * ASN1HEX.getString("xxxx0c03616161xxxxxx", 4) &rarr "aaa"
<span class='line'>702</span>  */</span><span class="WHIT">
<span class='line'>703</span> </span><span class="NAME">ASN1HEX.getString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">hextorstr</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorReturn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>711</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>712</span> 
<span class='line'>713</span> </span><span class="COMM">/**
<span class='line'>714</span>  * get OID string from hexadecimal encoded value&lt;br/>
<span class='line'>715</span>  * @name hextooidstr
<span class='line'>716</span>  * @memberOf ASN1HEX
<span class='line'>717</span>  * @function
<span class='line'>718</span>  * @param {String} hex hexadecmal string of ASN.1 DER encoded OID value
<span class='line'>719</span>  * @return {String} OID string (ex. '1.2.3.4.567')
<span class='line'>720</span>  * @since asn1hex 1.1.5
<span class='line'>721</span>  * @see {@link KJUR.asn1.ASN1Util.oidIntToHex}
<span class='line'>722</span>  * @description
<span class='line'>723</span>  * This static method converts from ASN.1 DER encoded 
<span class='line'>724</span>  * hexadecimal object identifier value to dot concatinated OID value.
<span class='line'>725</span>  * {@link KJUR.asn1.ASN1Util.oidIntToHex} is a reverse function of this.
<span class='line'>726</span>  * @example
<span class='line'>727</span>  * ASN1HEX.hextooidstr("550406") &rarr; "2.5.4.6"
<span class='line'>728</span>  */</span><span class="WHIT">
<span class='line'>729</span> </span><span class="NAME">ASN1HEX.hextooidstr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>730</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">zeroPadding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>731</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s.length</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>732</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">s.length</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">'0'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>734</span> 
<span class='line'>735</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>736</span> 
<span class='line'>737</span> </span><span class="WHIT">    </span><span class="COMM">// a[0], a[1]</span><span class="WHIT">
<span class='line'>738</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hex0</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>739</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i0</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hex0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NAME">i0</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">40</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>741</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">i0</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NUMB">40</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>742</span> 
<span class='line'>743</span> </span><span class="WHIT">    </span><span class="COMM">// a[2]..a[n]</span><span class="WHIT">
<span class='line'>744</span> </span><span class="WHIT">   </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hex1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>745</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">hex1.length</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>747</span> </span><span class="WHIT">    </span><span class="NAME">b.push</span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hex1.substr</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>748</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>750</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cbin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>751</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">b.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">0x80</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT">            </span><span class="NAME">cbin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cbin</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">zeroPadding</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">0x7f</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT">            </span><span class="NAME">cbin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cbin</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">zeroPadding</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">0x7f</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT">            </span><span class="NAME">c.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">cbin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT">            </span><span class="NAME">cbin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>760</span> 
<span class='line'>761</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a.join</span><span class="PUNC">(</span><span class="STRN">"."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>762</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">c.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"."</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">c.join</span><span class="PUNC">(</span><span class="STRN">"."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>764</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>765</span> 
<span class='line'>766</span> </span><span class="COMM">/**
<span class='line'>767</span>  * get string of simple ASN.1 dump from hexadecimal ASN.1 data&lt;br/>
<span class='line'>768</span>  * @name dump
<span class='line'>769</span>  * @memberOf ASN1HEX
<span class='line'>770</span>  * @function
<span class='line'>771</span>  * @param {Object} hexOrObj hexadecmal string of ASN.1 data or ASN1Object object
<span class='line'>772</span>  * @param {Array} flags associative array of flags for dump (OPTION)
<span class='line'>773</span>  * @param {Number} idx string index for starting dump (OPTION)
<span class='line'>774</span>  * @param {String} indent indent string (OPTION)
<span class='line'>775</span>  * @return {String} string of simple ASN.1 dump
<span class='line'>776</span>  * @since jsrsasign 4.8.3 asn1hex 1.1.6
<span class='line'>777</span>  * @description
<span class='line'>778</span>  * This method will get an ASN.1 dump from
<span class='line'>779</span>  * hexadecmal string of ASN.1 DER encoded data.
<span class='line'>780</span>  * Here are features:
<span class='line'>781</span>  * &lt;ul>
<span class='line'>782</span>  * &lt;li>ommit long hexadecimal string&lt;/li>
<span class='line'>783</span>  * &lt;li>dump encapsulated OCTET STRING (good for X.509v3 extensions)&lt;/li>
<span class='line'>784</span>  * &lt;li>structured/primitive context specific tag support (i.e. [0], [3] ...)&lt;/li>
<span class='line'>785</span>  * &lt;li>automatic decode for implicit primitive context specific tag 
<span class='line'>786</span>  * (good for X.509v3 extension value)
<span class='line'>787</span>  *   &lt;ul>
<span class='line'>788</span>  *   &lt;li>if hex starts '68747470'(i.e. http) it is decoded as utf8 encoded string.&lt;/li>
<span class='line'>789</span>  *   &lt;li>if it is in 'subjectAltName' extension value and is '[2]'(dNSName) tag
<span class='line'>790</span>  *   value will be encoded as utf8 string&lt;/li>
<span class='line'>791</span>  *   &lt;li>otherwise it shows as hexadecimal string&lt;/li>
<span class='line'>792</span>  *   &lt;/ul>
<span class='line'>793</span>  * &lt;/li>
<span class='line'>794</span>  * &lt;/ul>
<span class='line'>795</span>  * NOTE1: Argument {@link KJUR.asn1.ASN1Object} object is supported since
<span class='line'>796</span>  * jsrsasign 6.2.4 asn1hex 1.0.8
<span class='line'>797</span>  * @example
<span class='line'>798</span>  * // 1) ASN.1 INTEGER
<span class='line'>799</span>  * ASN1HEX.dump('0203012345')
<span class='line'>800</span>  * &darr;
<span class='line'>801</span>  * INTEGER 012345
<span class='line'>802</span>  *
<span class='line'>803</span>  * // 2) ASN.1 Object Identifier
<span class='line'>804</span>  * ASN1HEX.dump('06052b0e03021a')
<span class='line'>805</span>  * &darr;
<span class='line'>806</span>  * ObjectIdentifier sha1 (1 3 14 3 2 26)
<span class='line'>807</span>  *
<span class='line'>808</span>  * // 3) ASN.1 SEQUENCE
<span class='line'>809</span>  * ASN1HEX.dump('3006020101020102')
<span class='line'>810</span>  * &darr;
<span class='line'>811</span>  * SEQUENCE
<span class='line'>812</span>  *   INTEGER 01
<span class='line'>813</span>  *   INTEGER 02
<span class='line'>814</span>  *
<span class='line'>815</span>  * // 4) ASN.1 SEQUENCE since jsrsasign 6.2.4
<span class='line'>816</span>  * o = KJUR.asn1.ASN1Util.newObject({seq: [{int: 1}, {int: 2}]});
<span class='line'>817</span>  * ASN1HEX.dump(o)
<span class='line'>818</span>  * &darr;
<span class='line'>819</span>  * SEQUENCE
<span class='line'>820</span>  *   INTEGER 01
<span class='line'>821</span>  *   INTEGER 02
<span class='line'>822</span>  * // 5) ASN.1 DUMP FOR X.509 CERTIFICATE
<span class='line'>823</span>  * ASN1HEX.dump(pemtohex(certPEM))
<span class='line'>824</span>  * &darr;
<span class='line'>825</span>  * SEQUENCE
<span class='line'>826</span>  *   SEQUENCE
<span class='line'>827</span>  *     [0]
<span class='line'>828</span>  *       INTEGER 02
<span class='line'>829</span>  *     INTEGER 0c009310d206dbe337553580118ddc87
<span class='line'>830</span>  *     SEQUENCE
<span class='line'>831</span>  *       ObjectIdentifier SHA256withRSA (1 2 840 113549 1 1 11)
<span class='line'>832</span>  *       NULL
<span class='line'>833</span>  *     SEQUENCE
<span class='line'>834</span>  *       SET
<span class='line'>835</span>  *         SEQUENCE
<span class='line'>836</span>  *           ObjectIdentifier countryName (2 5 4 6)
<span class='line'>837</span>  *           PrintableString 'US'
<span class='line'>838</span>  *             :
<span class='line'>839</span>  */</span><span class="WHIT">
<span class='line'>840</span> </span><span class="NAME">ASN1HEX.dump</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hexOrObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>841</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>842</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.dump</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>845</span> 
<span class='line'>846</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hexOrObj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>847</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hexOrObj</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>848</span> </span><span class="WHIT">	</span><span class="NAME">hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hexOrObj.tohex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>849</span> 
<span class='line'>850</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_skipLongHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">limitNumOctet</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>851</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.length</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">limitNumOctet</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>852</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">hex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>853</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>854</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">limitNumOctet</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> 
<span class='line'>855</span> 		    </span><span class="STRN">"..(total "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hex.length</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"bytes).."</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT">		    </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">hex.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">limitNumOctet</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">limitNumOctet</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>857</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>858</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>859</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>860</span> 
<span class='line'>861</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">flags</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">"ommit_long_octet"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">32</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>862</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>863</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>864</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">skipLongHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">flags.ommit_long_octet</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>865</span> 
<span class='line'>866</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>867</span> 
<span class='line'>868</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"01"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>869</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>870</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"00"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>871</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"BOOLEAN FALSE\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>872</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>873</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"BOOLEAN TRUE\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>874</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>875</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>876</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"02"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>877</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>878</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"INTEGER "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_skipLongHex</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">skipLongHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>879</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>880</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>881</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>882</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_ASN1HEX.isASN1HEX</span><span class="PUNC">(</span><span class="NAME">v.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>883</span> </span><span class="WHIT">  	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"BITSTRING, encapsulates\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>884</span> </span><span class="WHIT">            </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="PUNC">(</span><span class="NAME">v.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>885</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>886</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>887</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"BITSTRING "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_skipLongHex</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">skipLongHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>888</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>889</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"04"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>891</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>892</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_ASN1HEX.isASN1HEX</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>893</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"OCTETSTRING, encapsulates\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>894</span> </span><span class="WHIT">	    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>895</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>896</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"OCTETSTRING "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_skipLongHex</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">skipLongHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"05"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>901</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"NULL\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>902</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>903</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>904</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>905</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidDot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.oidHexToInt</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>906</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.oid2name</span><span class="PUNC">(</span><span class="NAME">oidDot</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>907</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidSpc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oidDot.replace</span><span class="PUNC">(</span><span class="REGX">/\./g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>908</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oidName</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>909</span> </span><span class="WHIT">  	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"ObjectIdentifier "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">oidName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" ("</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">oidSpc</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">")\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>910</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>911</span> </span><span class="WHIT">  	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"ObjectIdentifier ("</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">oidSpc</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">")\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>912</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>913</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>914</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"0a"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>915</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"ENUMERATED "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>916</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>917</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"0c"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>918</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"UTF8String '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>919</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>920</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"13"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>921</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"PrintableString '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>922</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>923</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"14"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>924</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"TeletexString '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>925</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>926</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"16"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>927</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"IA5String '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>928</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>929</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"17"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>930</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"UTCTime "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>931</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>932</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"18"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>933</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"GeneralizedTime "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>934</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>935</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"1a"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>936</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"VisualString '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>937</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>938</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"1e"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>939</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"BMPString '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">ucs2hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>940</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>941</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>942</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"3000"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>943</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"SEQUENCE {}\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>944</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>945</span> 
<span class='line'>946</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"SEQUENCE\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>947</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>948</span> 
<span class='line'>949</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">flagsTemp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>950</span> </span><span class="WHIT">	
<span class='line'>951</span> 	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">aIdx.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>952</span> </span><span class="WHIT">	    </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>953</span> </span><span class="WHIT">	    </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">aIdx.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"04"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// supposed X.509v3 extension</span><span class="WHIT">
<span class='line'>954</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.oidname</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>955</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">flagsClone</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">JSON.parse</span><span class="PUNC">(</span><span class="NAME">JSON.stringify</span><span class="PUNC">(</span><span class="NAME">flags</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>956</span> </span><span class="WHIT">	    </span><span class="NAME">flagsClone.x509ExtName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oidName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>957</span> </span><span class="WHIT">	    </span><span class="NAME">flagsTemp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">flagsClone</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>958</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>959</span> </span><span class="WHIT">	
<span class='line'>960</span> 	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>961</span> </span><span class="WHIT">	    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flagsTemp</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>962</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>963</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>964</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>965</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"31"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>966</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"SET\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>967</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>968</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>969</span> </span><span class="WHIT">	    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>970</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>971</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>972</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>973</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>974</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">128</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// context specific </span><span class="WHIT">
<span class='line'>975</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tagNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">31</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>976</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">32</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// structured tag</span><span class="WHIT">
<span class='line'>977</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">tagNumber</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>978</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>979</span> </span><span class="WHIT">	    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>980</span> </span><span class="WHIT">		</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>981</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>982</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>983</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// primitive tag</span><span class="WHIT">
<span class='line'>984</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>985</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ASN1HEX.isASN1HEX</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>986</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">tagNumber</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>987</span> </span><span class="WHIT">		</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">_dump</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">flags</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>988</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">v.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"68747470"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// http</span><span class="WHIT">
<span class='line'>990</span> </span><span class="WHIT">		</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>991</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">flags.x509ExtName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"subjectAltName"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>992</span> </span><span class="WHIT">		       </span><span class="NAME">tagNumber</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>993</span> </span><span class="WHIT">		</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>994</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>995</span> </span><span class="WHIT">	    </span><span class="COMM">// else if (ASN1HEX.isASN1HEX(v))</span><span class="WHIT">
<span class='line'>996</span> 
<span class='line'>997</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">tagNumber</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"] "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>998</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>999</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1000</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1001</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">indent</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"UNKNOWN("</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">") "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> 
<span class='line'>1002</span> 	   </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1003</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1004</span> 
<span class='line'>1005</span> </span><span class="COMM">/**
<span class='line'>1006</span>  * parse ASN.1 DER hexadecimal string&lt;br/>
<span class='line'>1007</span>  * @name parse
<span class='line'>1008</span>  * @memberOf ASN1HEX
<span class='line'>1009</span>  * @function
<span class='line'>1010</span>  * @param {String} h hexadecimal string of ASN1. DER
<span class='line'>1011</span>  * @return {Object} associative array of ASN.1 parsed result
<span class='line'>1012</span>  * @since jsrsasign 10.5.3 asn1hex 1.1.x
<span class='line'>1013</span>  * @see KJUR.asn1.ASN1Util.newOjbect
<span class='line'>1014</span>  *
<span class='line'>1015</span>  * @description
<span class='line'>1016</span>  * This method parses ASN.1 DER hexadecimal string.
<span class='line'>1017</span>  * Its result can be applied to {@link KJUR.asn1.ASN1Util.newOjbect}.
<span class='line'>1018</span>  *
<span class='line'>1019</span>  * @example
<span class='line'>1020</span>  * ASN1HEX.parse("31193017...") &rarr; // RDN
<span class='line'>1021</span>  * {set: [{seq: [{oid: "localityName"}, {utf8str: {str: "Test"}}] }]}
<span class='line'>1022</span>  */</span><span class="WHIT">
<span class='line'>1023</span> </span><span class="NAME">ASN1HEX.parse</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1024</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1025</span> </span><span class="WHIT">	</span><span class="NAME">_parse</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.parse</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1026</span> </span><span class="WHIT">	</span><span class="NAME">_isASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.isASN1HEX</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1027</span> </span><span class="WHIT">	</span><span class="NAME">_getV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1028</span> </span><span class="WHIT">	</span><span class="NAME">_getTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1029</span> </span><span class="WHIT">	</span><span class="NAME">_getChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1030</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1031</span> </span><span class="WHIT">	</span><span class="NAME">_oidHexToInt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.ASN1Util.oidHexToInt</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1032</span> </span><span class="WHIT">	</span><span class="NAME">_oid2name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.x509.OID.oid2name</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1033</span> </span><span class="WHIT">	</span><span class="NAME">_hextoutf8</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1034</span> </span><span class="WHIT">	</span><span class="NAME">_ucs2hextoutf8</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ucs2hextoutf8</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1035</span> </span><span class="WHIT">	</span><span class="NAME">_iso88591hextoutf8</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iso88591hextoutf8</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1036</span> 
<span class='line'>1037</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tagName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1038</span> </span><span class="WHIT">	</span><span class="STRN">"0c"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"utf8str"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"12"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"numstr"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"13"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"prnstr"</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>1039</span> 	</span><span class="STRN">"14"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"telstr"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"16"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"ia5str"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"17"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"utctime"</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>1040</span> 	</span><span class="STRN">"18"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"gentime"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"1a"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"visstr"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"1e"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"bmpstr"</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>1041</span> 	</span><span class="STRN">"30"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"seq"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"31"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"set"</span><span class="WHIT">
<span class='line'>1042</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1043</span> 
<span class='line'>1044</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_parseChild</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1045</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1046</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1047</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1048</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1049</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1050</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pItem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_parse</span><span class="PUNC">(</span><span class="NAME">hTLV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1051</span> </span><span class="WHIT">	    </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">pItem</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1052</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1053</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1054</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1055</span> 
<span class='line'>1056</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1057</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1058</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1059</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"01"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1060</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"0101ff"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">bool</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1061</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">bool</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1062</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"02"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1063</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"int"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1064</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1065</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1066</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hV.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"00"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"not encap"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1067</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hV1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hV.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1068</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">_isASN1HEX</span><span class="PUNC">(</span><span class="NAME">hV1</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"not encap"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1069</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">bitstr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">obj</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_parse</span><span class="PUNC">(</span><span class="NAME">hV1</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1070</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1071</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1072</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hV.length</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">bV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">bitstrtobinstr</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1073</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bV</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1074</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">bitstr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1075</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1076</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">bitstr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">bin</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">bV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1077</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1078</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1079</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"04"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1080</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1081</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">_isASN1HEX</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"not encap"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1082</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">octstr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">obj</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_parse</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1083</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1084</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">octstr</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1085</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1086</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"05"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1087</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"null"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1088</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1089</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidDot</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_oidHexToInt</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1090</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_oid2name</span><span class="PUNC">(</span><span class="NAME">oidDot</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1091</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oidName</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1092</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">oid</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">oidDot</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1093</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1094</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">oid</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">oidName</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1095</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1096</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"0a"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1097</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hV.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1098</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"enum"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1099</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1100</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"enum"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1101</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1102</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"31"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1103</span> </span><span class="WHIT">	</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">tagName</span><span class="PUNC">[</span><span class="NAME">tag</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_parseChild</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1104</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1105</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"14"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// TeletexString</span><span class="WHIT">
<span class='line'>1106</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_iso88591hextoutf8</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1107</span> </span><span class="WHIT">	</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">tagName</span><span class="PUNC">[</span><span class="NAME">tag</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1108</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1109</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"1e"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// BMPString</span><span class="WHIT">
<span class='line'>1110</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ucs2hextoutf8</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1111</span> </span><span class="WHIT">	</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">tagName</span><span class="PUNC">[</span><span class="NAME">tag</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1112</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1113</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">":0c:12:13:16:17:18:1a:"</span><span class="PUNC">.</span><span class="NAME">indexOf</span><span class="PUNC">(</span><span class="NAME">tag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// Other Strings types</span><span class="WHIT">
<span class='line'>1114</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_hextoutf8</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1115</span> </span><span class="WHIT">	</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NAME">tagName</span><span class="PUNC">[</span><span class="NAME">tag</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">str</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1116</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1117</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag.match</span><span class="PUNC">(</span><span class="REGX">/^8[0-9]$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1118</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_hextoutf8</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1119</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">|</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1120</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">explicit</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1121</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s.match</span><span class="PUNC">(</span><span class="REGX">/[\x00-\x1F\x7F-\x9F]/</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'>1122</span> </span><span class="WHIT">		   </span><span class="NAME">s.match</span><span class="PUNC">(</span><span class="REGX">/[\u0000-\u001F\u0080–\u009F]/</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1123</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">explicit</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1124</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1125</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">explicit</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1126</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1127</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">tag.match</span><span class="PUNC">(</span><span class="REGX">/^a[0-9]$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1128</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1129</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">_isASN1HEX</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"not encap"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1130</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>1131</span> 			    </span><span class="NAME">explicit</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1132</span> </span><span class="WHIT">			    </span><span class="NAME">obj</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_parse</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1133</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1134</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tag"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">explicit</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1135</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1136</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1137</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1138</span> </span><span class="WHIT">	</span><span class="NAME">d.hV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1139</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.getLengthHexFromValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1140</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"asn1"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"tlv"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hL</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1141</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1142</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1143</span> 
<span class='line'>1144</span> </span><span class="COMM">/**
<span class='line'>1145</span>  * check if a hexadecimal tag is a specified ASN.1 context specific tag
<span class='line'>1146</span>  * @name isContextTag
<span class='line'>1147</span>  * @memberOf ASN1HEX
<span class='line'>1148</span>  * @function
<span class='line'>1149</span>  * @param {hTag} hex string of a hexadecimal ASN.1 tag consists by two characters (e.x. "a0")
<span class='line'>1150</span>  * @param {sTag} context specific tag in string represention (OPTION) (e.x. "[0]")
<span class='line'>1151</span>  * @return {Boolean} true if hTag is a ASN.1 context specific tag specified by sTag value.
<span class='line'>1152</span>  * @since jsrsasign 8.0.21 asn1hex 1.2.2
<span class='line'>1153</span>  * @description
<span class='line'>1154</span>  * This method checks if a hexadecimal tag is a specified ASN.1 context specific tag.
<span class='line'>1155</span>  * Structured and non-structured type of tag have the same string representation
<span class='line'>1156</span>  * of context specific tag. For example tag "a0" and "80" have the same string
<span class='line'>1157</span>  * representation "[0]".
<span class='line'>1158</span>  * The sTag has a range from from "[0]" to "[31]".
<span class='line'>1159</span>  * @example
<span class='line'>1160</span>  * ASN1HEX.isContextTag('a0', '[0]') &rarr; true // structured
<span class='line'>1161</span>  * ASN1HEX.isContextTag('a1', '[1]') &rarr; true // structured
<span class='line'>1162</span>  * ASN1HEX.isContextTag('a2', '[2]') &rarr; true // structured
<span class='line'>1163</span>  * ASN1HEX.isContextTag('80', '[0]') &rarr; true // non structured
<span class='line'>1164</span>  * ASN1HEX.isContextTag('81', '[1]') &rarr; true // non structured
<span class='line'>1165</span>  * ASN1HEX.isContextTag('82', '[2]') &rarr; true // non structured
<span class='line'>1166</span>  * ASN1HEX.isContextTag('a0', '[3]') &rarr; false
<span class='line'>1167</span>  * ASN1HEX.isContextTag('80', '[15]') &rarr; false
<span class='line'>1168</span>  *
<span class='line'>1169</span>  * ASN.1 tag bits
<span class='line'>1170</span>  * 12345679
<span class='line'>1171</span>  * ++        tag class(universal:00, context specific:10)
<span class='line'>1172</span>  *   +       structured:1, primitive:0
<span class='line'>1173</span>  *    +++++  tag number (0 - 31)
<span class='line'>1174</span>  */</span><span class="WHIT">
<span class='line'>1175</span> </span><span class="NAME">ASN1HEX.isContextTag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hTag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sTag</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1176</span> </span><span class="WHIT">    </span><span class="NAME">hTag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hTag.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1177</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ihtag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">istag</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1178</span> 
<span class='line'>1179</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1180</span> </span><span class="WHIT">	</span><span class="NAME">ihtag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hTag</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1181</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1182</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1183</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1184</span> </span><span class="WHIT">	
<span class='line'>1185</span>     </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sTag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1186</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">ihtag</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">192</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">128</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1187</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1188</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1189</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1190</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1191</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1192</span> 
<span class='line'>1193</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1194</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sTag.match</span><span class="PUNC">(</span><span class="REGX">/^\[[0-9]+\]$/</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1195</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1196</span> </span><span class="WHIT">	</span><span class="NAME">istag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">sTag.substr</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="NAME">sTag.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1197</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">istag</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">31</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1198</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">ihtag</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">192</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">128</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">   </span><span class="COMM">// ihtag & b11000000 == b10000000</span><span class="WHIT">
<span class='line'>1199</span> </span><span class="WHIT">	    </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">ihtag</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">31</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">istag</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// ihtag & b00011111 == istag (0-31)</span><span class="WHIT">
<span class='line'>1200</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1201</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1202</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1203</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1204</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1205</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1206</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1207</span> 
<span class='line'>1208</span> </span><span class="COMM">/**
<span class='line'>1209</span>  * simple ASN.1 DER hexadecimal string checker&lt;br/>
<span class='line'>1210</span>  * @name isASN1HEX
<span class='line'>1211</span>  * @memberOf ASN1HEX
<span class='line'>1212</span>  * @function
<span class='line'>1213</span>  * @param {String} hex string to check whether it is hexadecmal string for ASN.1 DER or not
<span class='line'>1214</span>  * @return {Boolean} true if it is hexadecimal string of ASN.1 data otherwise false
<span class='line'>1215</span>  * @since jsrsasign 4.8.3 asn1hex 1.1.6
<span class='line'>1216</span>  * @description
<span class='line'>1217</span>  * This method checks wheather the argument 'hex' is a hexadecimal string of
<span class='line'>1218</span>  * ASN.1 data or not.
<span class='line'>1219</span>  * @example
<span class='line'>1220</span>  * ASN1HEX.isASN1HEX('0203012345') &rarr; true // PROPER ASN.1 INTEGER
<span class='line'>1221</span>  * ASN1HEX.isASN1HEX('0203012345ff') &rarr; false // TOO LONG VALUE
<span class='line'>1222</span>  * ASN1HEX.isASN1HEX('02030123') &rarr; false // TOO SHORT VALUE
<span class='line'>1223</span>  * ASN1HEX.isASN1HEX('fa3bcd') &rarr; false // WRONG FOR ASN.1
<span class='line'>1224</span>  */</span><span class="WHIT">
<span class='line'>1225</span> </span><span class="NAME">ASN1HEX.isASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1226</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1227</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.length</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1228</span> 
<span class='line'>1229</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">intL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1230</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1231</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getL</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1232</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hVLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hex.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">hT.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">hL.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1233</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hVLength</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">intL</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1234</span> 
<span class='line'>1235</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1236</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1237</span> 
<span class='line'>1238</span> </span><span class="COMM">/**
<span class='line'>1239</span>  * strict ASN.1 DER hexadecimal string checker
<span class='line'>1240</span>  * @name checkStrictDER
<span class='line'>1241</span>  * @memberOf ASN1HEX
<span class='line'>1242</span>  * @function
<span class='line'>1243</span>  * @param {String} hex string to check whether it is hexadecmal string for ASN.1 DER or not
<span class='line'>1244</span>  * @return unspecified
<span class='line'>1245</span>  * @since jsrsasign 8.0.19 asn1hex 1.2.1
<span class='line'>1246</span>  * @throws Error when malformed ASN.1 DER hexadecimal string
<span class='line'>1247</span>  * @description
<span class='line'>1248</span>  * This method checks wheather the argument 'hex' is a hexadecimal string of
<span class='line'>1249</span>  * ASN.1 data or not. If the argument is not DER string, this 
<span class='line'>1250</span>  * raise an exception.
<span class='line'>1251</span>  * @example
<span class='line'>1252</span>  * ASN1HEX.checkStrictDER('0203012345') &rarr; NO EXCEPTION FOR PROPER ASN.1 INTEGER
<span class='line'>1253</span>  * ASN1HEX.checkStrictDER('0203012345ff') &rarr; RAISE EXCEPTION FOR TOO LONG VALUE
<span class='line'>1254</span>  * ASN1HEX.checkStrictDER('02030123') &rarr; false RAISE EXCEPITON FOR TOO SHORT VALUE
<span class='line'>1255</span>  * ASN1HEX.checkStrictDER('fa3bcd') &rarr; false RAISE EXCEPTION FOR WRONG ASN.1
<span class='line'>1256</span>  */</span><span class="WHIT">
<span class='line'>1257</span> </span><span class="NAME">ASN1HEX.checkStrictDER</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxHexLen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxByteLen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxLbyteLen</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1258</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1259</span> 
<span class='line'>1260</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxHexLen</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1261</span> </span><span class="WHIT">	</span><span class="COMM">// 1. hex string check</span><span class="WHIT">
<span class='line'>1262</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"not hex string"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1263</span> </span><span class="WHIT">	</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1264</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">KJUR.lang.String.isHex</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"not hex string"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1265</span> 
<span class='line'>1266</span> </span><span class="WHIT">	</span><span class="COMM">// 2. set max if needed</span><span class="WHIT">
<span class='line'>1267</span> </span><span class="WHIT">	</span><span class="COMM">// max length of hexadecimal string</span><span class="WHIT">
<span class='line'>1268</span> </span><span class="WHIT">	</span><span class="NAME">maxHexLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1269</span> </span><span class="WHIT">	</span><span class="COMM">// max length of octets</span><span class="WHIT">
<span class='line'>1270</span> </span><span class="WHIT">	</span><span class="NAME">maxByteLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.length</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1271</span> </span><span class="WHIT">	</span><span class="COMM">// max length of L octets of TLV</span><span class="WHIT">
<span class='line'>1272</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxByteLen</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0x80</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1273</span> </span><span class="WHIT">	    </span><span class="NAME">maxLbyteLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1274</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1275</span> </span><span class="WHIT">	    </span><span class="NAME">maxLbyteLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.ceil</span><span class="PUNC">(</span><span class="NAME">maxByteLen.toString</span><span class="PUNC">(</span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1276</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1277</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1278</span> </span><span class="WHIT">    </span><span class="COMM">//console.log(maxHexLen + ":" + maxByteLen + ":" + maxLbyteLen);</span><span class="WHIT">
<span class='line'>1279</span> 
<span class='line'>1280</span> </span><span class="WHIT">    </span><span class="COMM">// 3. check if L(length) string not exceeds maxLbyteLen</span><span class="WHIT">
<span class='line'>1281</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getL</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1282</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hL.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">maxLbyteLen</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1283</span> </span><span class="WHIT">	</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"L of TLV too long: idx="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1284</span> 
<span class='line'>1285</span> </span><span class="WHIT">    </span><span class="COMM">// 4. check if V(value) octet length (i.e. L(length) value) </span><span class="WHIT">
<span class='line'>1286</span> </span><span class="WHIT">    </span><span class="COMM">//    not exceeds maxByteLen</span><span class="WHIT">
<span class='line'>1287</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vblen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1288</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vblen</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">maxByteLen</span><span class="PUNC">)</span><span class="WHIT"> 
<span class='line'>1289</span> 	</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"value of L too long than hex: idx="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1290</span> 
<span class='line'>1291</span> </span><span class="WHIT">    </span><span class="COMM">// 5. check V string length and L's value are the same</span><span class="WHIT">
<span class='line'>1292</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1293</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hVLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> 
<span class='line'>1294</span> 	</span><span class="NAME">hTLV.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getL</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1295</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hVLength</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vblen</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1296</span> </span><span class="WHIT">	</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"V string length and L's value not the same:"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>1297</span> </span><span class="WHIT">		        </span><span class="NAME">hVLength</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vblen</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1298</span> 
<span class='line'>1299</span> </span><span class="WHIT">    </span><span class="COMM">// 6. check appending garbled string</span><span class="WHIT">
<span class='line'>1300</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1301</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">hTLV.length</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1302</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"total length and TLV length unmatch:"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>1303</span> </span><span class="WHIT">			    </span><span class="NAME">h.length</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"!="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hTLV.length</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1304</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1305</span> 
<span class='line'>1306</span> </span><span class="WHIT">    </span><span class="COMM">// 7. check if there isn't prepending zeros in DER INTEGER value</span><span class="WHIT">
<span class='line'>1307</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1308</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hT</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'02'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1309</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vidx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVidx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1310</span> </span><span class="WHIT">	</span><span class="COMM">// check if DER INTEGER VALUE have least leading zeros </span><span class="WHIT">
<span class='line'>1311</span> </span><span class="WHIT">	</span><span class="COMM">// for two's complement</span><span class="WHIT">
<span class='line'>1312</span> </span><span class="WHIT">	</span><span class="COMM">// GOOD - 3fabde... 008fad...</span><span class="WHIT">
<span class='line'>1313</span> </span><span class="WHIT">	</span><span class="COMM">// BAD  - 000012... 007fad...</span><span class="WHIT">
<span class='line'>1314</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">vidx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"00"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">h.charCodeAt</span><span class="PUNC">(</span><span class="NAME">vidx</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">56</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="COMM">// '8'=56</span><span class="WHIT">
<span class='line'>1315</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"not least zeros for DER INTEGER"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1316</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1317</span> 
<span class='line'>1318</span> </span><span class="WHIT">    </span><span class="COMM">// 8. check if all of elements in a structured item are conformed to</span><span class="WHIT">
<span class='line'>1319</span> </span><span class="WHIT">    </span><span class="COMM">//    strict DER encoding rules.</span><span class="WHIT">
<span class='line'>1320</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hT</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&</span><span class="WHIT"> </span><span class="NUMB">32</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// structured tag?</span><span class="WHIT">
<span class='line'>1321</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">intL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVblen</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1322</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1323</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1324</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1325</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tlv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1326</span> </span><span class="WHIT">	    </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tlv.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1327</span> </span><span class="WHIT">	    </span><span class="NAME">_ASN1HEX.checkStrictDER</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'>1328</span> 				   </span><span class="NAME">maxHexLen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxByteLen</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxLbyteLen</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1329</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1330</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">intL</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">sum</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1331</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"sum of children's TLV length and L unmatch: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>1332</span> </span><span class="WHIT">			    </span><span class="PUNC">(</span><span class="NAME">intL</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"!="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">sum</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1333</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1334</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1335</span> 
<span class='line'>1336</span> </span><span class="COMM">/**
<span class='line'>1337</span>  * get hexacedimal string from PEM format data&lt;br/>
<span class='line'>1338</span>  * @name oidname
<span class='line'>1339</span>  * @memberOf ASN1HEX
<span class='line'>1340</span>  * @function
<span class='line'>1341</span>  * @param {String} oidDotOrHex number dot notation(i.e. 1.2.3) or hexadecimal string for OID
<span class='line'>1342</span>  * @return {String} name for OID
<span class='line'>1343</span>  * @since jsrsasign 7.2.0 asn1hex 1.1.11
<span class='line'>1344</span>  * @description
<span class='line'>1345</span>  * This static method gets a OID name for
<span class='line'>1346</span>  * a specified string of number dot notation (i.e. 1.2.3) or
<span class='line'>1347</span>  * hexadecimal string.
<span class='line'>1348</span>  * @example
<span class='line'>1349</span>  * ASN1HEX.oidname("2.5.29.37") &rarr; extKeyUsage
<span class='line'>1350</span>  * ASN1HEX.oidname("551d25") &rarr; extKeyUsage
<span class='line'>1351</span>  * ASN1HEX.oidname("0.1.2.3") &rarr; 0.1.2.3 // unknown
<span class='line'>1352</span>  */</span><span class="WHIT">
<span class='line'>1353</span> </span><span class="NAME">ASN1HEX.oidname</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oidDotOrHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1354</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1355</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">KJUR.lang.String.isHex</span><span class="PUNC">(</span><span class="NAME">oidDotOrHex</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1356</span> </span><span class="WHIT">	</span><span class="NAME">oidDotOrHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.ASN1Util.oidHexToInt</span><span class="PUNC">(</span><span class="NAME">oidDotOrHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1357</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.x509.OID.oid2name</span><span class="PUNC">(</span><span class="NAME">oidDotOrHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1358</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oidDotOrHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1359</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1360</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1361</span> 
<span class='line'>1362</span> </span></pre></body></html>